﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace PlanoAula.BD
{
    [Table("PlanoAulaItem")]
    public class PlanoAulaDetalhe : TabelaBD
    {
        [Required]
        public string Conteudo { get; set; }

        public string Referencia { get; set; }

        [Required]
        public DateTime Data { get; set; }

        [Required]
        public Guid DiaAulaId { get; set; }
        public virtual DiaAula DiaAula { get; set; }

        [Required]
        public Guid PlanoAulaCabId { get; set; }
        public virtual PlanoAulaCab PlanoAulaCab { get; set; }
        
        public virtual ICollection<Avaliacao> Avaliacoes { get; set; }
    }
    public class PlanoAulaDetalheConfiguration : EntityTypeConfiguration<PlanoAulaDetalhe>
    {
        internal PlanoAulaDetalheConfiguration()
        {
            //this.HasRequired(e => e.PlanoAulaCabs)
            //  .WithMany()
            //  .HasForeignKey(e => e.PlanoAulaCabId).WillCascadeOnDelete(false);

            //this.HasRequired(d => d.PlanoAulaCab)
            //    .WithMany(p => p.PlanoAulaDetalhes)
            //    .HasForeignKey(d => d.PlanoAulaCabId);

            //this.HasRequired(d => d.DiaAula)
            //    .WithMany(da => da.PlanoAulaDetalhes)
            //    .HasForeignKey(d => d.DiaAulaId);
        }
    }

}
